	<cake:nocache>
	<?php
	// Element for updater controller	
	?>
	<table class="box-table-a">
	<thead>
	<tr>
	<th scope='col' style='width:70%'>Table name</th>
	<th scope='col'>Exist ?</th>
	<th scope='col'>Action</th>
	</tr>
	</thead>
	<tbody>
	<?php
	foreach($results as $result)
	{
		echo "<tr id='tr_".$result['name']."'>";
		echo "<td>".$result['name']."</td>";
		if ($result['created'])
		{
			echo "<td colspan='2'><img src='/img/check-success.png' style='vertical-align:middle;padding-right:10px;'></td>";
		}
		else
		{
			echo "<td><img src='/img/clear_icon.png' style='vertical-align:middle;padding-right:10px;'></td>";
			echo "<td>";
			echo '<button id="bu_'.$result['name'].'" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">Generate table</span></button>';
			echo "</td>";
			$this->Js->get("#bu_".$result['name']);
			$this->Js->event('click',
			$this->Js->request(
			array('controller' => 'updater','action'=>'createtable'),
			array(
			'type'=>'json',
			'method'=>'post',
			'update' => '#tableSQL',
			'data'=> '{name:"'.$result['name'].'"}',
			'dataExpression' => false,
			'error'=>'alert("An unexpected error has occurred!");'							
			)));
		}
		echo "</tr>";
	}
	?>
	</tbody>
	</table>
		
<?php echo $this->Js->writeBuffer(); ?>
</cake:nocache>